<?php

namespace App\Models;

use Carbon\Traits\Timestamp;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class TeamRole extends Model
{
    use HasFactory, Timestamp;

    protected $fillable = ['name'];

    public function users()
    {
        return $this->belongsToMany(User::class, 'team_role_user', 'role_id', 'user_id' );
    }

    public function team()
    {
        return $this->belongsTo(Team::class, 'team_id');
    }
}
